import request from '@/utils/request'

// 查询科目列表
export function listSubject(query) {
    return request({
        url: '/system/subject/list',
        method: 'get',
        params: query
    })
}

// 查询科目详细
export function getSubject(id) {
    return request({
        url: '/system/subject/' + id,
        method: 'get'
    })
}

// 新增科目
export function addSubject(data) {
    return request({
        url: '/system/subject',
        method: 'post',
        data: data
    })
}

// 修改科目
export function updateSubject(data) {
    return request({
        url: '/system/subject',
        method: 'put',
        data: data
    })
}

// 删除科目
export function delSubject(ids) {
    return request({
        url: '/system/subject/' + ids,
        method: 'delete'
    })
}

// 导出科目
export function exportSubject(query) {
    return request({
        url: '/system/subject/export',
        method: 'post',
        params: query
    })
}

// 查询科目树形列表
export function listSubjectTree() {
    return request({
        url: '/system/subject/tree',
        method: 'get'
    })
}

// 树形查询
export function tree( params) {
    return request({
        url: '/system/subject/tree',
        method: 'get',
        params:params
    })
}   
